package com.hq.shop06back.feign.api;

import com.hq.commons.ov.Goods;
import com.hq.shop06back.vo.GoodsType;
import com.hq.shop06back.vo.Stock;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "goods")
public interface GoodsService {

    @GetMapping("/goods/getGoods")
    public List<Goods> getGoods();

    @PostMapping("/goods/addGood")
    public Goods addGood(@RequestBody Goods goods);

    @PostMapping("/goods/updateGoods")
    public boolean updateGoods(@RequestBody Goods goods);

    @GetMapping("/goods/deleteGoods/{id}")
    public boolean deleteGoods(@PathVariable Integer id);


//    商品类别
    @GetMapping("/goodsType/getGoodsList")
    public List<GoodsType> getGoodsList();

    @PostMapping("/goodsType/addGoods")
    public boolean addGoods(GoodsType goodsType);

    @PostMapping("/goodsType/updateGoodsType")
    public boolean updateGoodsType(GoodsType goodsType);

    @GetMapping("/goodsType/deleteGoodsType/{id}")
    public boolean deleteGoodsType(@PathVariable("id") Integer id);

    @GetMapping("/goodsType/getGoodsTypeListByPid/{id}")
    public List<GoodsType> getGoodsTypeListByPid(@PathVariable("id") Integer id);

    /**
     * @author: HQ
     * @return:
     * @time: 2021/7/12 20:33
     * @description: 商品库存
     */


    /**
     * @author: HQ
     * @return:
     * @time: 2021/7/12 20:38
     * @description: 添加库存
     */
    @PostMapping("/stock/save")
    public Boolean save(Stock stock);

    @PostMapping("goods/save")
    public Goods addGoodAndStock(Goods goods);
}
